package be.djdb.preparts;

import java.awt.FlowLayout;

import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class MYField extends JComponent{
	protected String labelkey;
	protected JTextField input;
	protected JLabel label;
	@Deprecated
	public MYField() {
		gui("?no label?","");
	}
	public MYField(String label) {
		gui(label,"");
	}
	public MYField(String label,String text) {
		gui(label,text);
	}
	/**
	 * 
	 */
	private static final long serialVersionUID = 5605927215271988513L;

	private void settext(String txt) {
		input.setText(txt);
	}
	private void gui(String labeltext,String text) {
		input = new JTextField(text,20);
		labelkey = labeltext;
		this.label = new JLabel(labeltext);
		this.label.setLabelFor(input);
		this.label.setSize(100, 10);
		setLayout(new FlowLayout());
		super.add(this.label);
		super.add(input);
	}
	public void setText(String getlblFor) {
		label.setText(getlblFor);
	}
	public String getlbl() {
		return label.getText();
	}
	public void setToolTipText(String text){
		label.setToolTipText(text);
	}
}
